package com.wsoft.cms.controller;

import com.wsoft.cms.query.cate.auth.CateAuthUpdateQuery;
import com.wsoft.cms.service.ICmsCategoryAuthService;
import com.wsoft.response.ResponseResult;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import javax.validation.Valid;

/**
 * 公告类型授权表 前端控制器
 * @author Z001
 * @since 2024年11月27日 10:39:27
 */
@RestController
@Tag(name = "分类权限")
@RequestMapping("/cms/cateAuth")
public class CmsCategoryAuthController {

    @Resource
    private ICmsCategoryAuthService categoryAuthService;

    @Operation(summary = "修改分类权限", description = "修改分类权限")
    @PostMapping("/update")
    public ResponseResult update(@RequestBody @Valid CateAuthUpdateQuery query) {
        boolean b = categoryAuthService.updateCategoryAuth(query);
        if (b) {
            return ResponseResult.success("[sys.msg.success]");
        } else {
            return ResponseResult.failed("[sys.msg.failed]");
        }
    }

}
